package com.yequan.map;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yq
 * @date 2020/09/14
 */
public class HashMapDemo {
    static final HashMap<String, String> map = new HashMap<String, String>(2);
    public static void main(String[] args) throws InterruptedException {
//        concurrent();
        nullTest();
    }

    private static void nullTest() {
        Map<String, Long> map = new HashMap<>();
        Long a = map.get("a");
        System.out.println(a);
    }

    private static void concurrent() throws InterruptedException {
        Thread t = new Thread(() -> {
            for (int i = 0; i < 100000; i++) {
                int finalI1 = i;
                new Thread(() -> map.put(String.valueOf(finalI1), ""), "ftf" + i).start();
            }
        }, "ftf");
        t.start();
        t.join();
    }

}
